/*
 * MyApp.h
 *
 *  Created on: 2024年9月6日
 *      Author: nwz
 */

#ifndef CODE_MYAPP_H_
#define CODE_MYAPP_H_

#define CUSTOM_MENU_ID_START 100
enum {
	ID_MENU_WINDOW_NEW,
	ID_MENU_WINDOW_EDIT,
	ID_MENU_WINDOW_HIDE_BAR,
	ID_MENU_WINDOW_SHOW_BAR,
	//
	ID_MENU_TAB_NEW_TAB,
	ID_MENU_TAB_EDIT_TAB,
	ID_MENU_TAB_SAVE_TABS,
	ID_MENU_TAB_SELECT_TAB1,
	ID_MENU_TAB_SELECT_TAB2,
	ID_MENU_TAB_SELECT_TAB3,
	ID_MENU_TAB_SELECT_TAB4,
	ID_MENU_TAB_SELECT_TAB5,
	ID_MENU_TAB_SELECT_TAB6,
	ID_MENU_TAB_SELECT_TAB7,
	ID_MENU_TAB_SELECT_TAB8,
	ID_MENU_TAB_SELECT_TAB9,
	//
	ID_MENU_COMMAND_SAVE_COMMAND,
	ID_MENU_COMMAND_EDIT_COMMANDS,
	ID_MENU_COMMANDS,

	//
	ID_LAST
};

class MyApp: public wxApp {
public:

	virtual bool OnInit();
	virtual int OnExit();

	static void setActiveSubWindow(wxWindow*);
private:
	void createWindow(wxWindow *parent, struct table_tab &tab,
			struct table_tab_win *win);
	int createNewTabId();
	void createBasicMenu();
	void createCustomMenu();
	void createTab(struct table_tab *tb);
	void createTabs();
	void onMenu(wxCommandEvent &event);
	void onCustomMenu(wxCommandEvent &event);
	void onClose(wxCloseEvent&);
	void newWindow();
	void newTab();

	bool need_reset_db_menu = false;
};

#endif /* CODE_MYAPP_H_ */
